<?php

function displayRateRequest($Fare) {

    global $SESSID, $SESSCD;
    $prStr = '';
    $GETREQ = $GLOBALS['MYT']->db_array("SELECT * FROM hd_cambreqday
                WHERE req_Tmp = {$Fare['TmpOp']} AND req_htr = {$Fare['htr_ID']}
                AND sysUser = {$_SESSION[$SESSID]} AND sysOffice = {$_SESSION[$SESSCD]}
                AND req_Amount = '{$Fare['FraCalc']}'
                AND req_Cli = {$Fare['OBJCTCL']} AND req_Bnf = {$Fare['OBJCTRC']}");
    if (!isset($GETREQ[1]) || $GETREQ[1]['Status'] == 3) {
        $prStr .= '{req_rate} | Pts:';
        $prStr .= rt_field('text', 'ED', 'PTMod', '0', '3', '1', '', 'INPNUM" onKeyUp="MdRate();');
        $prStr .= '|';
        $prStr .= rt_field('text', 'ED', 'RTMod', '0.0000', '10', '3', '', 'INPNUM" onKeyUp="MdRate();" readonly="');
        $prStr .= '|';
        $prStr .= rt_field('button', 'ED', 'req_rt', '-->', '', '', '', '"
	onclick="if (document.InvoiceProperties.PTMod.value.toString().search(/^-?[0-9]+$/) == 0 && document.InvoiceProperties.PTMod.value!=0) {
		document.InvoiceProperties.action=\'_response/call.php?get=Operative/opv_remittancerate\';
		document.InvoiceProperties.PRSVOR.disabled=true;
		subform(\'InvoiceProperties\',\'ORRate\');
	}');
    } else {
        include('opv_remittancerate.php');
    }
    return $prStr;
}
$remittanceRateRequest = displayRateRequest($_POST);
if (isset($prStr)) { $prStr .= $remittanceRateRequest;}else{echo $remittanceRateRequest;}
?>